package com.yao.cloud.consumer.apiclient;

import com.yao.cloud.consumer.entity.ServerEntity;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author yaoyuming
 * @date 2019/12/04 16:30
 */

@FeignClient(value = "eureka-server")
public interface EurekaApi {

    @RequestMapping(value="/server/get", method = RequestMethod.GET)
    public String getServerInfo();

    /***************************************home**********************************/
    // json
    @RequestMapping(value="/home/post/server", method=RequestMethod.POST)
    public ServerEntity post1(@RequestParam("name") String name);

    @RequestMapping(value="/home/post/serverBody", method=RequestMethod.POST)
    public ServerEntity post2(ServerEntity server);

    @RequestMapping(value="/home/get/server", method=RequestMethod.GET)
    public ServerEntity get(@RequestParam("name") String name, @RequestHeader("access_token") String token);

    /*************************************** List带给我们的坑 **********************************/

    @RequestMapping(value = "/home/list", method = RequestMethod.GET)
    public List<String> list(@RequestParam("ids") List<Integer> ids);

}
